﻿using Bricks.Unity.Injecting;
using Microsoft.Practices.Unity;

namespace Motar.Web.UnityExtensions
{
    
    /// <summary>
    /// 
    /// </summary>
    public static class UnityContainerExtensions
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="unityContainer"></param>
        public static void EndRequestLifetime(this IUnityContainer unityContainer)
        {
            unityContainer.EndLifetime<HttpRequestLifetimeManager>();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="unityContainer"></param>
        public static void EndSessionLifetime(this IUnityContainer unityContainer)
        {
            unityContainer.EndLifetime<HttpSessionLifetimeManager>();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="unityContainer"></param>
        public static void EndApplicationLifetime(this IUnityContainer unityContainer)
        {
            unityContainer.EndLifetime<HttpApplicationLifetimeManager>();
        }
    }
}
